#include <stdio.h>
#include <string.h>
#define MAX 20

char *includeStr(char s[], char t[])
{    		 
    int i, j, k;
    for (i = 0; s[i]; ++i) //1
    {    		 
        if (s[i] == t[0])  //1
        {    		 
            k = i + 1; //1
            for (j = 1; t[j] == s[k] && s[k] && t[j]; ++k, ++j); //1
            if (t[j] == '\0') return s + i; //1
        }
    }
    return 0;
}    		 

void delStr(char s[], char t[])
{    		 
    char *p;
    while (p = includeStr(s, t)) //1
        strcpy(p, p + strlen(t)); //1
}    		 

int main()
{    		 
    char s[MAX];
    char t[MAX];
    scanf("%s", s);
    scanf("%s", t);
    delStr(s, t); //1
    printf("%s\n", s); //1
    return 0;
}    	